package com.mtnz.njk.Controller;

import com.mtnz.njk.Service.InquiryManagerService;
import com.mtnz.njk.result.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: 用户咨询客服控制层
 * @Author: FBL
 * @CreateDate: 2019\8\22 0022 14:21
 * @Version: 1.0
 */
@RestController
@RequestMapping("/inquiry")
@CrossOrigin
public class InquiryManagerController {
    @Autowired
    InquiryManagerService inquiryManagerService;

    /**
     * 咨询客服列表
     *
     * @param inquiryStatus
     * @param key
     * @param pageNum
     * @param pageSize
     * @return
     * @throws Exception
     */
    @PostMapping("/listInquiry")
    public ResponseResult listInquiry(Integer inquiryStatus, String key, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize) throws Exception {
        return inquiryManagerService.listInquiry(inquiryStatus, key, pageNum, pageSize);
    }

    /**
     * 处理咨询请求
     *
     * @param inquiryStatus
     * @param inquiryId
     * @return
     * @throws Exception
     */
    @PostMapping("/dealInquiry")
    public ResponseResult dealInquiry(Integer inquiryStatus, Integer inquiryId) throws Exception {
        return inquiryManagerService.dealInquiry(inquiryStatus, inquiryId);
    }
}
